package pub.developers.forum.domain.repository;

import pub.developers.forum.api.response.data.LastMonthData;
import pub.developers.forum.api.response.data.YestData;
import pub.developers.forum.api.response.user.UserInfoResponse;
import pub.developers.forum.common.model.PageRequest;
import pub.developers.forum.common.model.PageResult;
import pub.developers.forum.domain.entity.Follow;
import pub.developers.forum.domain.entity.User;

import java.util.List;


public interface UserRepository {

    // 删除
    void delete(Long id);

    void save(User user);

    User get(Long id);

    User getByEmail(String email);

    User getByOpenid(String openid);

    void update(User user);

    List<User> queryByIds(List<Long> ids);

    PageResult<User> page(PageRequest<User> pageRequest);

    void follow(Long followed, Long id);

    PageResult<User> pageFollower(PageRequest<Long> longPageRequest);

    PageResult<User> pageFans(PageRequest<Long> longPageRequest);

    Follow getFollow(Long followed, Long follower);

    void cancelFollow(Long followId);

    PageResult<User> pageActive(PageRequest pageRequest);

    //获取当前登录用户的粉丝
    List<UserInfoResponse> querySelfFans(Long id);

    List<UserInfoResponse> selectSelfFollower(Long id);

    //根据用户id , 拿到用户信息
    UserInfoResponse getUserInformation(Long id);

    //将邮件存入redis数据库中
    void saveCode(String email , String emailCode);

    String rightCode(String email);

    //拿到当前登录用户的个人信息
    User selfInformation(Long id);

    //根据当前登录用户的id , 拿到用户的openid (不能返回给前端)
    String queryOpenId(Long id);

    //拿到我点赞的帖子的id
    PageResult<Long> queryMyLoveId(Long id , Integer pageNo , Integer pageSize);

    //拿到昨日的新增用户 , 新增帖子 , 新增互动数的数据
    YestData queryYestDayData();

    List<LastMonthData> queryMonthCount(String type);

    PageResult<UserInfoResponse> queryMyLove(Object userId , Integer pageSize , Integer pageNo);

}
